package com.ruoyi.zxjd.exposure.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zxjd.exposure.mapper.ExposureProgressMapper;
import com.ruoyi.zxjd.exposure.domain.ExposureProgress;
import com.ruoyi.zxjd.exposure.service.IExposureProgressService;
import com.ruoyi.common.core.text.Convert;

/**
 * 查看进度Service业务层处理
 * 
 * @author lcc
 * @date 2021-02-07
 */
@Service
public class ExposureProgressServiceImpl implements IExposureProgressService 
{
    @Autowired
    private ExposureProgressMapper exposureProgressMapper;

    /**
     * 查询查看进度
     * 
     * @param progressId 查看进度ID
     * @return 查看进度
     */
    @Override
    public ExposureProgress selectExposureProgressById(Long progressId)
    {
        return exposureProgressMapper.selectExposureProgressById(progressId);
    }

    /**
     * 查询查看进度列表
     * 
     * @param exposureProgress 查看进度
     * @return 查看进度
     */
    @Override
    public List<ExposureProgress> selectExposureProgressList(ExposureProgress exposureProgress)
    {
        return exposureProgressMapper.selectExposureProgressList(exposureProgress);
    }

    /**
     * 新增查看进度
     * 
     * @param exposureProgress 查看进度
     * @return 结果
     */
    @Override
    public int insertExposureProgress(ExposureProgress exposureProgress)
    {
        exposureProgress.setCreateBy(ShiroUtils.getLoginName());
        exposureProgress.setCreateTime(DateUtils.getNowDate());
        return exposureProgressMapper.insertExposureProgress(exposureProgress);
    }

    /**
     * 修改查看进度
     * 
     * @param exposureProgress 查看进度
     * @return 结果
     */
    @Override
    public int updateExposureProgress(ExposureProgress exposureProgress)
    {
        exposureProgress.setUpdateBy(ShiroUtils.getLoginName());
        exposureProgress.setUpdateTime(DateUtils.getNowDate());
        return exposureProgressMapper.updateExposureProgress(exposureProgress);
    }

    /**
     * 删除查看进度对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExposureProgressByIds(String ids)
    {
        return exposureProgressMapper.deleteExposureProgressByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除查看进度信息
     * 
     * @param progressId 查看进度ID
     * @return 结果
     */
    @Override
    public int deleteExposureProgressById(Long progressId)
    {
        return exposureProgressMapper.deleteExposureProgressById(progressId);
    }

    @Override
    public int updateExposureProgressStatusById(Long progressId, String status) {
        return exposureProgressMapper.updateExposureProgressStatusById(progressId,status);
    }
}
